package simulator;

import java.awt.EventQueue;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTabbedPane;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.border.EmptyBorder;
import javax.swing.table.DefaultTableModel;

import cartago.OPERATION;
import cartago.tools.GUIArtifact;

public class GuiDomainUser extends GUIArtifact {
    
    GuiView view;
    
    public void init(){
        view = new GuiView();
        view.setVisible(true);
    }
	
	@OPERATION void mostrarResultados(){
        //view.mostrar();
    }
    
    // Actions that simulate the building progress

    
    class GuiView extends JFrame {        
        
		private JPanel contentPane;
		private JTextField textField;
		private JTextField textField_1;
		private JTextField textField_2;
		private JTextField textField_3;
		private JTable table_6;
        
        public GuiView(){
            setTitle(" -- Gui Domain User -- ");
            setSize(800,600);
			setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
			setBounds(100, 100, 660, 411);
			contentPane = new JPanel();
			contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
			setContentPane(contentPane);
			contentPane.setLayout(null);
			
			JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
			tabbedPane.setBounds(0, 73, 644, 300);
			contentPane.add(tabbedPane);

			DefaultTableModel datos2 = new DefaultTableModel();
			datos2.addColumn("Documentos");
			datos2.addColumn("Descripcion");
			datos2.addColumn("Razon");
			String[] row4 = {"Cuatro","Desc","razon1"};
			datos2.addRow(row4);
			String[] row5 = {"Cinco","Desc","razon1"};
			datos2.addRow(row5);
			String[] row6 = {"Seis","Desc","razon1"};
			datos2.addRow(row6);
			
			JPanel panel_5 = new JPanel();
			tabbedPane.addTab("Document Storage", null, panel_5, null);
			panel_5.setLayout(null);
			
			JLabel lblDescriptors = new JLabel("Descriptors");
			lblDescriptors.setBounds(36, 26, 119, 14);
			panel_5.add(lblDescriptors);
			
			JScrollPane scrollPane_8 = new JScrollPane();
			scrollPane_8.setBounds(36, 40, 233, 120);
			panel_5.add(scrollPane_8);
			
			table_6 = new JTable();
			table_6.setModel(new DefaultTableModel(
				new Object[][] {
					{"Descriptor 1", Boolean.FALSE},
					{"Descriptor 2", Boolean.FALSE},
				},
				new String[] {
					"Descriptor", ""
				}
			) {
				Class[] columnTypes = new Class[] {
					Object.class, Boolean.class
				};
				public Class getColumnClass(int columnIndex) {
					return columnTypes[columnIndex];
				}
				boolean[] columnEditables = new boolean[] {
					false, true
				};
				public boolean isCellEditable(int row, int column) {
					return columnEditables[column];
				}
			});
			table_6.getColumnModel().getColumn(0).setPreferredWidth(130);
			table_6.getColumnModel().getColumn(1).setPreferredWidth(35);
			scrollPane_8.setViewportView(table_6);
			
			JButton btnStorage = new JButton("Storage");
			btnStorage.setBounds(179, 187, 89, 23);
			panel_5.add(btnStorage);
			JLabel lblTask = new JLabel("Task:");
			lblTask.setBounds(10, 27, 46, 14);
			contentPane.add(lblTask);
			
			JLabel lblWorker = new JLabel("Worker:");
			lblWorker.setBounds(157, 27, 46, 14);
			contentPane.add(lblWorker);
			
			JLabel lblGroup = new JLabel("Group:");
			lblGroup.setBounds(312, 27, 46, 14);
			contentPane.add(lblGroup);
			
			JLabel lblWorkflow = new JLabel("Workflow:");
			lblWorkflow.setBounds(486, 27, 61, 14);
			contentPane.add(lblWorkflow);
			
			textField = new JTextField();
			textField.setBounds(40, 24, 86, 20);
			textField.setEditable(false);
			textField.setName("task");
			contentPane.add(textField);
			textField.setColumns(10);
			
			textField_1 = new JTextField();
			textField_1.setBounds(202, 24, 86, 20);
			textField_1.setEditable(false);
			contentPane.add(textField_1);
			textField_1.setColumns(10);
			
			textField_2 = new JTextField();
			textField_2.setBounds(359, 24, 86, 20);
			textField_2.setEditable(false);
			contentPane.add(textField_2);
			textField_2.setColumns(10);
			
			textField_3 = new JTextField();
			textField_3.setBounds(548, 24, 86, 20);
			textField_3.setEditable(false);
			contentPane.add(textField_3);
			textField_3.setColumns(10);
		}
        
    }

}
